<style lang="less" scoped>
.depaBtn {
  height: 1.9rem;
  line-height: 1.4rem;
  position: fixed;
  /* bottom: 4.5rem; */
  left: 20px;
  width: 100%;
  /* background: #fff; */
  /* border: 1px solid #ddd; */
  text-align: left;
  color: red;
  font-size: 14px;
}
.noDate_page {
  padding-top: 1.9rem;
}
</style>

<!--司机端发车页-->
<template>
  <div class="gridContainer">
    <manage-header></manage-header>
    <header-car :status="3"></header-car>
    <div class="depaBtn">
      点击下面图标完成发车操作。
    </div>

    <div class="noDate_page_icon"
         @click='DriverDeparture()'>
      <x-button :gradients="['#23a5a5', '#23a5a5']"
                class="noDate_icon"> <i class="iconfont icon-delivery-customer bule"></i></x-button>
      <!-- <div class="noDate_icon">

        <i class="iconfont icon-delivery-customer bule"></i>
      </div> -->
    </div>
    <footer-menu :status='1'></footer-menu>
  </div>
</template>

<script>
import manageHeader from "@/components/core/header/manage.header.vue";
import headerCar from '@/components/core/header/driver-progress.vue'
import footerMenu from "@/components/core/footer/manage.footer.vue";
import { mapGetters, mapState } from "vuex";

export default {
  components: {
    footerMenu,
    headerCar,
    manageHeader,
  },
  data () {
    return {
      datas: [
        {
          ATVNo: '',
          AtvGuid: '',
          list: [],
        }
      ],
      totalRecords: 0,
    }
  },
  computed: {
    userinfo () {
      return localStorage.userinfo ? JSON.parse(localStorage.userinfo) : null
    },
    ...mapState({
      pagetitle: state => state.cfg.appBarTitle,
      showstate: state => state.cfg.showAppBar,
    }),
    ...mapGetters({
      scrollerHeight: "cfg/getConHeight"
    }),
  },
  created () {
    //this.DriverDeparture();
  },
  mounted () {
    this.$store.dispatch("cfg/setConHeight");
  },
  methods: {
    DriverDeparture () {
      let query = {
        Driver1Guid: this.userinfo.StaffID,
      };
      this.Ajax.post("DriverDeparture", query).then(resp => {
        if (resp.IsSuccess) {
          this.Toast({
            message: "发车成功"
          });
        } else {
          this.Toast({
            message: "发车失败:" + resp.ErrorMessage
          });
        }
      });
    },



  }
}
</script>